
public class QuickSortStrategy implements SortingStrategy {
	String[] v;
	
	public void sort(String[] v) {
		quickSort(v, 0, v.length);
	}
	
	public void quickSort(String[] v, int st1, int dr1) {
		int st = st1;
		int dr = dr1;
		String mij;
		
		if(st1 > dr1) {
			mij = v[(st1+dr1)/2];
			while(st <= dr) {
				while ((st < dr1) && (v[st].compareTo(mij) < 0))
					++st;
				while ((dr > st1) && (v[dr].compareTo(mij) > 0))
					--dr;
				if(st <= dr) {
					String t = v[dr];
					v[dr] = v[st];
					v[st] = t;
					++st;
					--dr;
				}
			}
			if(st1 < dr) 
				quickSort(v, st1, dr);
			if(st < dr1)
				quickSort(v, st, dr1);
		}
	}

}
